package io.File;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        File file =new File("d:/test.txt");
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getCanonicalFile());

        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        //创建文件
        boolean ret=file.createNewFile();
        System.out.println("ret="+ret);

        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

    }
}
